﻿using ChurchDiary.BLL;
using ChurchDiary.TableEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ChurchWebsite.Areas.Website.Controllers
{
    public class AlbumSongsController : Controller
    {
        //
        // GET: /Website/AlbumSongs/

        public ActionResult Album()
        {
            return View();
        }
        public JsonResult AddAlbum(EntityAlbums Album)
        {
            return Json(new BLL_Website().InsertAlbum(Album), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateAlbum(EntityAlbums Album)
        {
            return Json(new BLL_Website().UpdateAlbum(Album), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteAlbum(Guid dataId)
        {
            return Json(new BLL_Website().DeleteAlbum(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbums(int page,string searchkey)
        {
            return Json(new BLL_Website().GetAlbums(page, searchkey), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbum(Guid dataId)
        {
            return Json(new BLL_Website().GetAlbum(dataId), JsonRequestBehavior.AllowGet);
        }
        public ActionResult Songs()
        {
            return View();
        }
        public JsonResult AddAlbumSongs(EntitySongs Songs)
        {
            return Json(new BLL_Website().InsertSong(Songs), JsonRequestBehavior.AllowGet);
        }
        public JsonResult UpdateAlbumSongs(EntitySongs Songs)
        {
            return Json(new BLL_Website().UpdateSong(Songs), JsonRequestBehavior.AllowGet);
        }
        public JsonResult DeleteAlbumSongs(Guid dataId)
        {
            return Json(new BLL_Website().DeleteSong(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbumSongs()
        {
            return Json(new BLL_Website().GetSongs(), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbumSong(Guid dataId)
        {
            return Json(new BLL_Website().GetSong(dataId), JsonRequestBehavior.AllowGet);
        }
        public JsonResult GetAlbumSongByAlbum(Guid dataId)
        {
            return Json(new BLL_Website().GetSongsByAlbums(dataId), JsonRequestBehavior.AllowGet);
        }
    }
}
